Skip to main content

All Questions

1vote
1answer
112views

How to delete a string in my files?

So I want to match all below then remove those lines of string. [MTT-5634](https://my.atlassian.net/browse/MTT-5634) [MCC-123](https://my.atlassian.net/browse/MCC-123) [MTT-7965]: https://my.atlassian....
Beelzebub's user avatar
-1votes
2answers
123views

line start string and end string matches then it needs to replace end string of a line and ignore any string that matches in between of same line

Require a shell script for the below issue elecj_test: |1009676|F|269.13348200|3|348415|237.06|0.00|0.00|||SSPPPSSSPSSS|UNTESTED|| If a line starts with elecj_test: and ends with || it needs to ...
sathavahana's user avatar
0votes
1answer
647views

Replacing multiple lines with sed using a scriptfile (sed -f)

Based on the awesome answer found here, I'm trying to use some of these commands inside a sed scriptfile that will be called using sed -f. The file has multiple sed commands and it's been working ...
Felipe's user avatar
0votes
1answer
415views

Script to remove all modules in pom.xml except the one with the highest number

Question I have a huge pom.xml from a Talend DI/ESB project, where it was possible to have multiple lines for the same module with different Talend specific versions (don't even ask for that :-( ) ...
aw-think's user avatar
6votes
3answers
1kviews

Replace MAC address with UUID

I am looking for a way to mask the client MAC address every time it appears in a logfile before using the logfile to present data to a customer (GDPR rules). I can identify the MAC string using regex,...
Rob Davie's user avatar
0votes
2answers
830views

extract field from file using sed or awk

I have bash script to collect all hardware info but following memory info piece is missing, so this is what i am trying to do. Following command give you status of DIMM memory module, [root@Linux ~...
Satish's user avatar
  • 1,672
0votes
2answers
4kviews

sed: regex input buffer length larger than INT_MAX

I have a big file to which I am doing various operations, and this error just came up. I tried googling it but there didn't find any result with this. sed: regex input buffer length larger than ...
Chris's user avatar
1vote
2answers
7kviews

How to insert text between two set patterns with sed?

I need to insert text between two set patterns in a large set of files. I need to change every line with this form: <a href="/entry/someFile"> To this: <a href="/entry/someFile.xhtml"> I'...
Daniel Sweet's user avatar
0votes
1answer
2kviews

Replace all Social Security Number (SSN) digits with X's

I want a sed command that will change all the numbers in all Social Security # sequences (formatted only like this 123-45-6789 or this 123456789) to X's. Any sequence of numbers that are not formatted ...
velkoon's user avatar
3votes
2answers
2kviews

How can I find matches with sed (or similar) for configuration parameters?

I'm pretty good at using php's preg_match (and similar) commands, and I'm also pretty good with regular expressions, but I don't do very well with sed. I have two shell scripts I'm working on and I'd ...
cwd's user avatar
  • 46.7k
10votes
2answers
46kviews

Sed: replacing digits

I am trying to write some install scripts for when I install/upgrade Ubuntu. I'm having trouble with fixing logrotate.d: /var/log/ufw.log { rotate 7 weekly missingok notifempty compress delaycompress ...
GrandSatrap's user avatar

close